package com.gjy.design.observer.push;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author gjy
 * @version 1.0
 * @since 2025-11-07 10:07:44
 */
public class CurrentConditionsDisplay implements Observer {
    private static final Logger log = LoggerFactory.getLogger(CurrentConditionsDisplay.class);

    private float temperature;
    private float humidity;
    private float pressure;

    @Override
    public void update(float temperature, float humidity, float pressure) {
        this.temperature = temperature;
        this.humidity = humidity;
        this.pressure = pressure;
        display();
    }

    public void display() {
        log.info("当前条件: {}°C, 湿度: {}%, 气压: {}", temperature, humidity, pressure);
    }

}
